import 'package:json_annotation/json_annotation.dart';

part 'cart.g.dart';

@JsonSerializable()
class ShopCartModel {
  bool checked;

  String imgUrl;

  String name;

  String attrStr;

  double price;

  int num;

  ShopCartModel(
      {this.checked = false,
      required this.imgUrl,
      required this.name,
      required this.attrStr,
      required this.price,
      this.num = 1});


  factory ShopCartModel.fromJson(Map<String, dynamic> json) =>
      _$ShopCartModelFromJson(json);

  Map<String, dynamic> toJson() => _$ShopCartModelToJson(this);

  @override
  String toString() {
    return toJson().toString();
  }
}
